package com.mselivanov.vf5android;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class MovesActivity extends Activity {
	
	public static final String CHARACTER_KEY = "character-type";
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.moves_view);
		
		int movesType = Characters.TYPE_DEFAULT;
		int characterIndex = Characters.CHARACTER_DEFAULT;
		
		if (getIntent() != null) {
			Bundle bundle = getIntent().getExtras();
			if (bundle != null) {
				movesType = bundle.getInt(CharacterSelectActivity.MOVES_TYPE_KEY);
				characterIndex = bundle.getInt(CHARACTER_KEY);
			}
		}
		
		String movesUrl = "file:///android_asset/html/" 
			+ characterIndex 
			+ "_"
			+ movesType
			+ ".html";
		
		WebView movesView = (WebView) findViewById(R.id.movesView);
		movesView.loadUrl(movesUrl);
	}

}
